public class Solution2186 {
    public int minSteps(String s, String t) {
        int[] f=new int[26];
        int[] g=new int[26];
        for (char c : s.toCharArray()) {
            f[c-'a']++;
        }
        for (char c : t.toCharArray()) {
            g[c-'a']++;
        }
        int count=0;
        for (int i = 0; i < 26; i++) {
            count+=Math.max(f[i],g[i])-Math.min(f[i],g[i]);
        }
        return count;
    }

    public static void main(String[] args) {
        System.out.println(new Solution2186().minSteps("leetcode","coats"));
    }
}
